<?php

require_once(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))) . '/appconf.php');

$local_config = array(
	'this_cgi'	=>	'cms/builder/custom/api/product/tnc.php',

);

class cms_builder_custom_api_tnc extends Site{

	function setup(){
		$this->run_modes('get_default_remark');
		$this->start_mode('get_default_remark');
		$this->set_path_info_position(array('id'=>1));
		parent::setup();
	}
	function cgiapp_prerun($rm=''){
	}
	
	function action_get_default_remark(){
		$id = $this->get_param('q', 'id', 1, 'int');
		$dbh_r = $this->db_connect('read');
		$obj = db_selectrow_array($dbh_r, 'select body from product_tnc where id=? and status=1', $id);
        return json_encode($obj);
	}
}//end class

$webapp = new cms_builder_custom_api_tnc(
   array('PARAMS' => array_merge($site_global_config, $local_config))
         );
$webapp->run();

/* Custom Helper Function Implementation start here */

?>
